package com.jintian.smart.kernel.switching.admin.controller;

import com.jintian.smart.kernel.core.web.RestResultWrapper;
import com.jintian.smart.kernel.switching.admin.service.SwitchingAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/switching/admin")
@RestResultWrapper
public class SwitchingAdminController {
    @Autowired
    private SwitchingAdminService switchingService;

    @RequestMapping(path = "/trigger/build", method = RequestMethod.GET)
    public boolean rebuildTrigger(String tableName) {
        return switchingService.rebuildTrigger(tableName);
    }

    @RequestMapping(path = "/trigger/buildAll", method = RequestMethod.GET)
    public boolean rebuildTriggerAll() {
        return switchingService.rebuildTriggerAll();
    }
}
